class Solution(object):
    def missingNumber(self, nums):
        n = len(nums)
        s = set()
        for i in range(n+1):
            s.add(i)
        for i in nums:
            s.remove(i)
        return s.pop()

if __name__ == '__main__':
    s = Solution()
    r = s.missingNumber([0, 1])
    print(r)
